package iBuyCoolSky.ui;

import iBuyCoolSky.obsevers.Sensor;

import java.awt.Dimension;
import java.util.Observable;
import java.util.Observer;

import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.JLabel;

public class RightPanel extends JPanel implements Observer{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public JLabel image_label;
	private JPanel newPanel;
	public RightPanel()
	{
		this.setPreferredSize(new Dimension(640,500));
		image_label=new JLabel(new ImageIcon("picture/6.jpg"));
		JPanel startPanel = new JPanel();
		startPanel.add(image_label);
		newPanel = startPanel;
		add(newPanel);
		
	}
	public void update(Observable subject, Object obj)
	{
		remove(newPanel);
		newPanel = (JPanel)((Sensor)subject).getData();		
		add(newPanel);
		validate();
		repaint();
	}

}
